import pandas as pd
from sklearn.model_selection import train_test_split


class preprocess_data():

    # Read the initial CSV file
    data = pd.read_csv('ratings.csv')

    # Split data into train and test sets
    train_data, test_data = train_test_split(data, test_size=0.1)

    # Save the train and test sets to new CSV files with specified paths
    train_data.to_csv('train.csv', index=False)  # Specify the path for train.csv
    test_data.to_csv('test.csv', index=False)  # Specify the path for test.csv
